package io.renren.modules.evaluate.service.imp;

import io.renren.modules.evaluate.entity.NormMesEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.evaluate.dao.IndexMesDao;
import io.renren.modules.evaluate.service.IndexMesService;


@Service("indexMesService")
public class IndexMesServiceImpl extends ServiceImpl<IndexMesDao, NormMesEntity> implements IndexMesService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        IPage<NormMesEntity> page = this.page(
                new Query<NormMesEntity>().getPage(params),
                new QueryWrapper<NormMesEntity>().eq("status","0")
        );
        return new PageUtils(page);
    }

    @Override
    public NormMesEntity queryByIndexName(String indexName){
        return baseMapper.queryByIndexName(indexName);
    }

    @Override
    public boolean logicalDelete(List<Integer> delIdx){
        return baseMapper.logicalDelete(delIdx);
    }

    @Override
    public List<NormMesEntity> getByNormName(String normName){
        return baseMapper.getByNormName(normName);
    }
}